%macro get_f1098e;


	proc printto new log = "&logdir./get_f1098e.txt";
	run;


	/****************************************************
	*			Put individuals into a tinlist			*
	****************************************************/
	%make_tinlist;


	

			options errors = 0;
				proc sql noprint;
				[connection details redacted]
					create table sample as
					select * from connection to iq 
					(
					select 
						a.[redacted] as person_id,
						a.[redacted] as payer_id,
						max(a.s[redacted]) as sl_int
					from [redacted] as a
						inner join #tinlist as b
							on(a.[redacted] = b.person_id)
					where a.[redacted] = &base_yr
						and a.tin_typ<=4
					group by a.[redacted],
						a.[redacted]
					);
				disconnect from iq;
				quit;




		/****************************
		*		Take a proc sum		*
		****************************/
		proc means data = sample nway noprint;
			class person_id;
			output out = rlib.f1098e(drop=_type_ _freq_)
				sum(sl_int) = 
					sl_int;
	

	proc printto;
	run;

	


%mend;
